@extends('common.base-master')

@section('html-head')
    {{--<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>--}}
@endsection

@section('html-body')
    <div class="myadd-page">

        @if(count($address_list) > 0)
            @foreach($address_list as $address)
        <div class="address-container" data-id="{{$address->id}}">
            <div class="bg-star_icon @if($address->is_default == 0)hidden @endif"></div>
            <div class="name-phone">{{$address->realname}}，{{$address->phone}}</div>
            <div class="addree">{{$address->province}}{{$address->city}}{{$address->area}}{{$address->info}}</div>
            <div class="delete-btn hidden" id="del_{{$address->id}}">删除</div>
        </div>
            @endforeach
        @endif
        <a href="{{route('Home.User.changeAddress')}}" class="add-add">新增地址</a>
    </div>
    <script>
        $(document).ready(function () {
            var type = "{{$type}}";

//            $(".address-container").on("swipeleft",function(){
//                var id = $(this).data('id');
//                $('#del_' + id).removeClass('hidden');
//            });
//
//            $('.address-container').click(function () {
//                var id = $(this).data('id');
//                if(type == 'change'){
//                    $('#del_' + id).removeClass('hidden');
//                }else if(type == 'choice'){
//
//                }
//            });


        });
    </script>
@endsection